#include <iostream>
using namespace std;

// Factorial

template<long long i>
struct Factorial {
    const static long long value = i * Factorial<i-1ll>::value;
};

template<>
struct Factorial<0ll> {
    const static long long value = 1;
};

// Fibonacci

template<long long i>
struct Fibonacci {
    const static long long value = Fibonacci<i-1>::value + Fibonacci<i-2>::value;
};

template<>
struct Fibonacci<1ll> {
    const static long long value = 1;
};

template<>
struct Fibonacci<2ll> {
    const static long long value = 1;
};

int main() {
    cout << 10 << '\t' << Factorial<10>::value << endl;
    cout << 20 << '\t' << Factorial<20>::value << endl;
    cout << 30 << '\t' << Factorial<30>::value << endl;

    cout << 3 << '\t' << Fibonacci<3>::value << endl;
    cout << 10 << '\t' << Fibonacci<10>::value << endl;
    cout << 50 << '\t' << Fibonacci<50>::value << endl;
    return 0;
}
